<?php
 require_once('../../../inc/header.inc.php');
 require_once(BX_DIRECTORY_PATH_INC.'design.inc.php');
 require_once(BX_DIRECTORY_PATH_INC.'profiles.inc.php');
 require_once(BX_DIRECTORY_PATH_INC.'utils.inc.php');
 include BX_DIRECTORY_PATH_MODULES.'ibdw/spywall/config.php';
  
 //Dichiarazione variabili
 $pagina='##spydata##'.$_POST['pagina'];
 $contanews=$_POST['contanews'];
 $ultimoid=$_POST['ultimoid']; 
 $mioid=$_POST['idrichiesto'];

 $db=mysql_connect(DATABASE_HOST,DATABASE_USER,DATABASE_PASS);
 mysql_query("SET NAMES 'utf8'");
 if ($db == FALSE) die ("errore di connessione");
 mysql_select_db(DATABASE_NAME,$db) or die ("errore selezione database");
 $varlink = strpos($pagina, 'member.php');
 $varlinkhome = strpos($pagina, 'index.php');
 
 //riutilizzo masterquery impostando i valori limite
 $parami=0;
 $cont=$limite;
 $soloup="true";
 include 'templatesw.php';
 include 'masterquery.php';
 $soloup="false";
 
 $result=mysql_query($query,$db) or die(mysql_error());
 $sviluppo=mysql_num_rows($result);
 if($sviluppo != 0) 
 {
  $GLOBAL['ultimoid']=$ultimoid;
  include 'basecore.php';
  echo '<script> $(document).ready(function() {aggiornabottonealtrenews('.$contanews.','.$limite.',\''.$pagina.'\',\''.$mioid.'\','.$ultimoid.');});';
 }
?>